package org.zebra.web.converter;

import cn.hutool.core.date.DateUtil;
import org.springframework.core.convert.converter.Converter;

import java.util.Date;

/**
 * 参数字符串转换日期
 *
 * @author zhanghongbin
 */
public class StringToDateConverter implements Converter<String, Date> {

    @Override
    public Date convert(String source) {
        try {
            return DateUtil.parse(source).toJdkDate();
        } catch (Exception e) {

        }
        return null;
    }
}
